package day07;

import java.util.Random;

public class Exercise4 {
    public static void main(String[] args) {
        /*
        需求:生成?位验证码(大写字母、小写字母、数字)

        String c=p(4);
        System.out.println(c);

         */

    }
    /*public static String p(int len){
        String code="";//验证码
        char[] cha={'1','2','3','4','5','6'};//验证码组成
        Random rand=new Random(cha.length);//随机数
        for (int i=0;i<=len;i++){
            int index=rand.nextInt(cha.length);
            code+=cha[index];
        }
        return code;

    }

     */

    public static String q(int len){
         String code="";
         char[] cha={'a','b','c','d','e','f'};
         Random r=new Random(cha.length);
         for (int i=0;i<=len;i++){
             int d=r.nextInt(cha.length);
             code+=cha[d];
         }
         return code;
    }
}
